package com.caiheng.api.service.setmeal.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.caiheng.api.dao.setmeal.SetMealInfoGivenMapper;
import com.caiheng.api.entity.setmeal.SetMealInfoGiven;
import com.caiheng.api.service.base.impl.BaseServiceImpl;
import com.caiheng.api.service.setmeal.SetMealInfoGivenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 套餐规格下的 赠送消费券金额Service业务层处理
 *
 * @author ruoyi
 * @date 2022-06-07
 */
@Service
public class SetMealInfoGivenServiceImpl extends BaseServiceImpl<SetMealInfoGivenMapper, SetMealInfoGiven> implements SetMealInfoGivenService {

    @Resource
    private SetMealInfoGivenMapper mealInfoGivenMapper;

    @Override
    public List<SetMealInfoGiven> getGivenListByMealInfoId(int mealInfoId) {
        QueryWrapper<SetMealInfoGiven> qw  = new QueryWrapper<>();
        qw.eq("meal_info_id",mealInfoId);
        qw.eq("state",1);
        return mealInfoGivenMapper.selectList(qw);
    }
}
